package _23.celue;

import java.io.Console;

/**
 * @author xizizzz
 * @description: TODO
 * @date 2021-9-22上午 08:52
 */
public class Context {

    private Strategy strategy;

    public Context(Strategy strategy) {
        this.strategy = strategy;
    }

    //上下文接口
    public void ContextInterface() {
        strategy.AlgorithmInterface();
    }

    public static void main(String[] args) {
        Context Context;
        //A
        Context = new Context(new ConcreteStrategyA());
        Context.ContextInterface();
        //B
        Context = new Context(new ConcreteStrategyB());
        Context.ContextInterface();
        //C
        Context = new Context(new ConcreteStrategyC());
        Context.ContextInterface();
    }
}
